1. Field of the Invention
The present invention relates to a method, system, and program for destaging data in cache.
2. Description of the Related Art
A storage subsystem, such as the International Business Machines (xe2x80x9cIBMxe2x80x9d) Enterprise Storage Server (xe2x80x9cESSxe2x80x9d)**, will receive Input/Output (I/O) requests directed toward an attached storage system. The attached storage system may comprise an enclosure including numerous interconnected disk drives, such as a Direct Access Storage Device (DASD), Redundant Array of Independent Disks (RAID Array), Just A Bunch of Disks (JBOD), etc. If I/O requests are received at a faster rate then they can be processed, then the storage subsystem will queue the I/O requests in a system cache, which may comprise one or more gigabytes of volatile storage, e.g., Random Access Memory (RAM), Dynamic Random Access Memory (DRAM), etc. A copy of certain modified (write) data may also by placed in a non-volatile storage unit (NVS), such as a battery backed-up volatile memory, to provide additional protection of write data in the event of a failure at the storage subsystem.
**IBM and Enterprise Storage Server are trademarks of International Business Machines Crop. 
An entry is included in a Least Recently Used (LRU) list for each track in cache. A track can be staged from the storage system to cache to return to a read request. Additionally, write data for a track may be stored in cache before being transferred to the attached storage system. When additional space in cache is needed to buffer additional requested read data and modified data, tracks indicated at the LRU end of the LRU list are destaged to disk. An entry is added to the most recently used (MRU) end of the LRU list for each track added to cache. Each entry in the LRU list comprises a control block that indicates the current status of a track, the location in cache, and the location in the storage system. An additional NVS LRU list is maintained for tracks in the NVS. The cache and NVS LRU lists include entries for tracks in both NVS and cache.
Notwithstanding the use of cache LRU lists to manage destaging operations, there is a need in the art for improved techniques for managing data in cache and performing the destage operation.
Provided is a method, system, and program for destaging data from a first computer readable medium to a second computer readable medium. A list of entries indicating data blocks in the first computer readable medium is scanned. For each entry scanned, a determination is made as to whether the data block indicated in the scanned entry satisfies a criteria. If the data block indicated in the scanned entry satisfies the criteria, then a destage operation is called to destage the data block in the scanned entry from the first computer readable medium to the second computer readable medium. If the called destage operation is not initiated, then the scanned entry is removed from the cache list. The removed scanned entry is added to one destage wait list. During one destage operation, data blocks indicated in entries in the destage wait list are destaged.
In further implementations, there are a plurality of destage wait lists, each associated with one of a plurality of criteria used to qualify data blocks for destage. In such case, a determination is made of the destage wait list associated with the criteria used to determine whether to call the destage operation for the data block. The removed scanned entry is added to the determined destage wait list.
In still further implementations, the first computer readable medium comprises a volatile memory used as a cache and the second computer readable medium comprises a non-volatile storage device. Still further, the non-volatile storage device may be configured as a Redundant Array of Independent Disks (RAID) and the criteria may specify one RAID rank in the storage device. In such case, the destage operation is called if the data block indicated in the scanned entry is stored in the specified RAID rank in the storage device.
In further RAID implementations, there are a plurality of destage wait lists, each associated with one RAID rank in the storage device. In such case, a determination is made of the destage wait list associated with the RAID rank specified in the criteria. The removed scanned entry is added to the determined destage wait list for the specified RAID rank.
The described implementations provide techniques for destaging data from a first storage to a second storage, such as from cache to disk, in a manner that uses two lists of entries to manage the destage operations.